package com.web_bloks.mvc.client;

/**
 * 
 * @author Jean-Lou Dupont
 *
 */
public class Mediator extends Notifier implements IMediator {

	/**
	 * The default name of the <code>Mediator</code>.
	 */
	public static final String NAME = "Mediator";
	
	/** 
	 * The name of the <code>Mediator</code>.
	 */
	protected String mediatorName = null;

	/**
	 * The view component
	 */
	protected Object viewComponent = null;

	/**
	 * Constructor for deferred binding
	 * Should be used for forward enhancements.
	 */
	public Mediator() {
		super();
	}
	
	public void init(String mediatorName, Object viewComponent) {
		this.mediatorName = (mediatorName != null) ? mediatorName:NAME; 
		this.viewComponent = viewComponent;			
	}

	/**
	 * GETTER name
	 */
	public String getMediatorName() {
		return this.mediatorName;
	}

	/**
	 * GETTER view
	 */
	public Object getViewComponent() {
		return this.viewComponent;
	}

	/**
	 * GETTER for notification interests
	 */
	public String[] listNotificationInterests() {
		throw new RuntimeException( "override listNotificationInterests" );
	}

	public void handleNotification(INotification notification) {
		throw new RuntimeException( "override handleNotification" );
	}

}//END